import { NTime, type TimeProps } from "naive-ui";
import type { HTMLAttributes } from "vue";

export class TimeFactory {
  private props: TimeProps = {};
  private attrs: HTMLAttributes = {};

  constructor(data?: { props?: TimeProps; attrs?: HTMLAttributes }) {
    if (data?.props) this.setProps(data.props);
    if (data?.attrs) this.setAttrs(data.attrs);
  }

  setProps(props: TimeProps) {
    this.props = props;
    return this;
  }

  setAttrs(attrs: HTMLAttributes) {
    this.attrs = attrs;
    return this;
  }

  create() {
    return <NTime {...this.attrs} {...this.props}></NTime>;
  }
}
